package com.boot.communal.response;

import java.util.Date;

/**
 * 封装请求响应的状态码信息
 *
 * @author 【zhouJie】
 */
public enum ResponseCode {

    SUCCESS(200, "操作成功" , true, new Date()),
    ERROR(500, "操作失败" , false, new Date()),
    Authorization_Expired(1003, "授权过期" , false, new Date()),
    No_Authority(403, "没有权限" , false, new Date()),
    No_Authorization(405, "没有授权" , false, new Date()),
    Unbound_Phone1008(1008, "未绑定手机号码(有unionId)" , false, new Date()),
    Unbound_Phone1009(1009, "未绑定手机号码(无unionId)" , false, new Date());

    private int code;
    private String message;
    private boolean isSuccess;
    private Date time;

    ResponseCode(int code, String message, boolean isSuccess, Date time) {
        this.code = code;
        this.message = message;
        this.isSuccess = isSuccess;
        this.time = time;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public boolean isSuccess() {
        return isSuccess;
    }

    public Date getTime() {
        return time;
    }

}
